package ch4;

import java.util.Scanner;

public class Triangle2 {

	public static void main(String[] args) {
		// 等腰三角形，*个数分别1,3,5,7,9
		// 三角形
		Scanner in = new Scanner(System.in);
		System.out.println("请输入直角三角形高度：");
		int w = in.nextInt();
		for (int i = 1; i <= w; i++) {
			for (int j = w; j >= i; j--) {
				System.out.print(" ");
			}
			for (int j = 1; j <= 2 * i - 1; j++) {
				System.out.print("*");
			}
			System.out.println();
		}
	}

}
